package com.qf.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101000656227";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJUZKoIvQlTRw1O6+Hy2xluFCAeNeAjvbUDIhScg6ji2og1Q61Tlp6K6XX5xji6w/BhDNfu1plG5GKMC42cZ5i8s2JmS337FCJoMkNgtrxMInZZmf5rxYSLGnkq6Cc9Xsf3nhU+5WMBYF5lm+p2jJh7lRk8DFHIg+QMKPB2ePaLpCs3sDm3cZgTD8kGHP54sws/cZOZzlajniAWCokIJV5eZS3G6qlOuj5poico2GiO4zI6JDdPXhJTflaE6u6+38quBjZ6bCNtII0nctSXegyk4dAZp0UBv1IWjdPSe+4a9T2zBSNRHRsGhU8ZYImb0S6oCG0ILYEY9d49Fjt9iI/AgMBAAECggEAJHurv0gqHY7zI6GL7UQ6tHvXx4pTlzBkm8oInf73rLPpqndwxPLgTv0xvr8DeaaCNSPukkywo5RDgrdyT7y4HAnuWdR8xhXe//Hb+N7/VH1U4pG2pjvCXWm3aK3AqnL+F2WACvQcs2rzD17MpA/4utQbUAYQ0ZlXETQbDfHZ+6ln2J4dbE9y2eerVBuOQRaBibw2awRE1tH9E7s4DlO8JerliHJuL4K3lNv/AZoLWE75+MLvbyMKFw5QZljGFlP0R7EfP2VEvBwIvHvpIumwpsV/XMzKcykvLP6+17cL0jfC9vs0HrCYbzL8edN3VgvKjK37tXjzhzVuXv/TxwKzgQKBgQC/V6huQccJ+lhKz41JUQdjzfDUzSP6CPhItMwwfgZEus4yHAsrfvfT1/sguatlWuVUJ/ieq+0rf/r7u9z82MKrTble5fbP5m7hJoi+UTQJyfa819hYXZeARQTRySeOpMT9kLJCYwQJo3Stn+sec6QX6pXnE/32+UtuptOx+RQkEQKBgQC3uINzmgUL47XkR0TanBWIPiZn5pyU9aACbWM5FQWE4o7Ath4aFdc9Aszt8y9P0CdQ68oCvyCHNng5tk73HZcPy746Nb/jKXdPp4IPjPji7iNvKQnl6V7PjNypeN/QJnog3vt8+vU2RPqgDpIDlKMO0Ag5R+k3IYvyqkflfRvxTwKBgFC5aazCgXd7L764G7Jfxg9cNguBVHlLSXxbEn4u3PQoH4/Sdv/tvB6a0y72RhInq/K6PlCq1g9xGfEUS+I8jLx6uQcJW/xQCl1gxXYNijfLBhabtYFqUt1hwOvEwrSSXS1g22PYpD5wwGvzuN0LCqKwbHel3pJQkHtpVIyUOeQRAoGBAK3FlHAvaj6Ir26wCmxL3gHz5xe3hLtQaHxjQsqnG4VJVYTpvScnKWLH11XqAwIW/FkJ7RUT+oxp9OWBjscl8dA7Aj7EwC749aUd52MWEAN1A4cM5hPU3Jyru7uAXRHgkvusbWsVZAJk1Dm4Dlvcpy5Hjr+/SNOgo2JvtXlXEKr5AoGAbJ5/PKhbDDFvUtg2KBkE5Pr/uIZOoZeSBA/GW3PhJag+HNYDt6963LY5iIuutGWruydbum75Vogd+tPpDDhftyA/+5Obhuy58+rh4g/ALYomVXSV17fGsgjYCt2TXLSaXeo57C+0CrlDvy8E7Pk268XRqSuLwU3xlQIvk4RN6E4=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArC+n7jVK2EtqhtynNGDxdFVYrwT8jP2gu3VsRu7CSfdsAfuDTrwmeuKeaQCBQ19gSAslwTzfip8ebIsiA6jnhRrpNbd+c3FxBxHR6tB6pG2tvBPB6EtQAStRTjPWkiTF1laTbcynuKsiW8X4dgX92PxPfW/Fx8bHgDgxrEBhrURUtZHuQh6VBdUyLHAnpVKU+zQ06p+h4H4O/Ch+fv0KAzAHe9Z1XVot2hswa+UJM1H2am5y2DU5K1gw3s8anGoOMnc4tFsXW4yDEZQrspxbhtLiU7tWc4fvd4GEQ7Ye7OoPIWtUZq1iyra8TMtT2KIhyYRqj+1K21HyMsJkmf0cvwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://4st2zz.natappfree.cc/pay/ali/updateOrder";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://www.baidu.com";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关地址，如果这里要完成的真实的扣款业务，这里需要把网关换成https://openapi.alipay.com/gateway.do
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
